* Schooled by Strikes? The Effects of Large-Scale Labor Unrest on Mass Attitudes Towards the Labor Movement
* AFL-CIO Polling Consortium Data Analysis

/* Methodological statement on Polling Consortium data

The surveys were conducted online. The samples were drawn from opt-in panels of American adults. 
Panel members were matched to the voter file, and were included in the samples if the voter file 
indicated they were registered voters. Respondents were also sampled to be representative of the 
national population of registered voters. Because individual panel members are often invited to 
participate in multiple surveys in a single invitation, it is impossible to calculate participation 
rates for each individual survey.

*/

* Set log

log using aflcio, replace

* Load replication data for AFL-CIO

use "aflcio_strikestate.dta"

* Descriptive statistics

sum union_therm_nomiss strike_treatment age_years race_cat_white race_cat_black race_cat_hisp hhinc unionhh parent_bin ideo3_cat_lib ideo3_cat_cons party3_cat_dem party3_cat_rep educ3_cat_somecol educ3_cat_col if strike_state==1 [aw=survey_weight]

* Basic summary of union thermometer pre/post strike in strike states

table strike_treatment [aw=survey_weight], c(mean union_therm_nomiss n union_therm_nomiss)

* Basic regressions - strike states only, union thermometer

global controls female c.age_years##c.age_years race_cat_white race_cat_black race_cat_hisp hhinc unionhh parent_bin ideo3_cat_lib ideo3_cat_cons party3_cat_dem party3_cat_rep educ3_cat_somecol educ3_cat_col

reg union_therm_nomiss strike_treatment [aweight=survey_weight], robust
estimates store aflcio1
reg union_therm_nomiss strike_treatment i.state_fip i.survey_date [aweight=survey_weight], robust
estimate store aflcio2
reg union_therm_nomiss strike_treatment $controls i.state_fip i.survey_date [aweight=survey_weight], robust
estimate store aflcio3

reg union_therm_nomiss strike_treatment $controls i.state_fip i.survey_date [aweight=survey_weight] if parent_bin==1, robust
estimate store aflcio_parent

reg union_therm_nomiss strike_treatment $controls i.state_fip i.survey_date [aweight=survey_weight] if parent_bin==0, robust
estimate store aflcio_noparent

* Output Models 1-3 in Appendix 5

esttab aflcio1 aflcio2 aflcio3 using "aflcio_models123.csv", replace keep(strike_treatment) mtitle("Model 1" "Model 2" "Model 3")

* Output Models 4-5 in Appendix 5

esttab aflcio_parent aflcio_noparent using "aflcio_models45.csv", replace keep(strike_treatment) mtitle("Model 4" "Model 5")

* End log and export

log close
